home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14738 < prev    next >
Encoding:
Text File  |  1996-08-05  |  4.1 KB  |  226 lines

  1. Path: argonet.co.uk!argbd86
  2. From: Charlotte Tomlinson <eeyore@argonet.co.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Borland 3.0 - Newbie question
  5. Date: Mon, 01 Apr 1996 23:29:50
  6. Organization: UnipalmPIPEX server (post doesn't reflect views of UnipalmPIPEX
  7. Distribution: world
  8. Message-ID: <internews46B841C45E@argonet.co.uk>
  9. References: <4jpfo5$1js@druid.borland.com>
  10. Reply-To: Charlotte Tomlinson <eeyore@argonet.co.uk>
  11. NNTP-Posting-Host: am201.du.pipex.com
  12. X-Newsreader: VTi Voyager InterNews 0.15 for Acorn RISC OS (Patched by RA)
  13.  
  14. mstave@wpo.borland.com (Matt Stave) wrote:
  15. > To make an application that you can run, you need to produce an .exe.
  16. > What are xxx and yyy?
  17.  
  18. Matt,
  19.  
  20. I have several errors of a similar nature.  
  21.  
  22. (Before I go any further, many thanks if you can help!!)
  23.  
  24. I get one as "Linker error: Undefined symbol str::operator delete(void
  25. near*) in module REVDICT.CPP".
  26. The other, complains about a template I set up, with just different
  27. classes used as the list node type, an example is "Linker error: Undefined
  28. symbol dllist<fuzzyel>::dllist<fuzzyel>(const dllist<fuzzyel> near&) in
  29. module REVDICT.CPP".
  30.  
  31. I have neither of these particular fns anywhere in the code.
  32.  
  33. I have the files set up something like this:
  34.  
  35. ////str.h
  36. /*...*/
  37.  
  38. #include <stdio.h>
  39. #include <string.h>
  40. #include <stdlib.h>
  41. #include <ctype.h>
  42.  
  43. class str
  44. {
  45.         private:
  46.  
  47.         void copy(const char*);
  48.         void copy(char);
  49.         void copy(int);
  50.         void release();
  51.         void concat(const char*, const char *);
  52.  
  53.         protected:
  54.  
  55.         int length;
  56.         char* ptr;
  57.  
  58.         public:
  59.         int getLength() const;
  60.         str();
  61.         str(const char*);
  62.         str(char);
  63.         str(const str&);
  64.         str(int);
  65.         ~str();
  66.         /*=,+,== and others*/
  67.         char& operator[](int) const;
  68.         int operator()(const str&, int) const;
  69.         static void* operator new(size_t);
  70.         static void operator delete(void*);
  71. };
  72.  
  73.  
  74. /*fns...*/
  75.  
  76.  
  77. ////str.cpp
  78.  
  79. #include "str.h"
  80.  
  81. void* str::operator new(size_t size)
  82. {
  83. void* temp=new char[size];
  84. if(temp==0)
  85.         puts("Out of heap space");
  86. return temp;
  87. }
  88.  
  89. void operator delete(void* p)
  90. {
  91. delete p;
  92. }
  93.  
  94.  
  95. char& str::operator[](int index) const
  96. {
  97. if(index<0||index>=length)
  98.         {
  99.         putchar('\a');
  100.         static char dummy;
  101.         dummy='\0';
  102.         return dummy;
  103.         }
  104. return ptr[index];
  105. }
  106.  
  107.  
  108. ////fuzzyel.h
  109.  
  110. #include "str.cpp"
  111.  
  112. class fuzzyel {
  113.         private:
  114.  
  115.         str element;
  116.         int membership;
  117.  
  118.         public:
  119.  
  120.         fuzzyel (str string="", int memval=100)
  121.                  : element(string),membership(memval) {};
  122.         fuzzyel(const fuzzyel&);
  123.         ~fuzzyel();
  124.  
  125. /*some fns*/
  126. };
  127.  
  128. /*fns*/
  129.  
  130.  
  131.  
  132. ////dllist.h
  133.  
  134. #include <iostream.h>
  135. #include<stdlib.h>
  136.  
  137. /*..*/
  138.  
  139. //node & list
  140.  
  141. template <class T> class node
  142. {
  143.         public:
  144.  
  145.         T data;
  146.  
  147.         node<T> *next;
  148.         node<T> *prev;
  149.  
  150. /*...*/
  151. };
  152.  
  153. template <class T> class dllist : public node<T>
  154. {
  155.         node<T> *start, *end;
  156.         void copy(const dllist<T>);
  157.  
  158.         public:
  159.  
  160.         dllist() {start=end=NULL;}
  161.         dllist(const dllist<T>&);
  162. /*some list fns*/
  163. };
  164.  
  165.  
  166. ////fuzzyset.h
  167.  
  168. /*..*/
  169. #include "fuzzyel.h"
  170. #include <stdio.h>
  171. #include "dllist.cpp"
  172.  
  173. class fuzzyset {
  174.         private:
  175.         dllist<fuzzyel> members;
  176.  
  177.         public:
  178.         fuzzyset() {}
  179.         fuzzyset(const fuzzyset&);
  180.         fuzzyset(const fuzzyel&);
  181.         ~fuzzyset() {}
  182. /*fns*/
  183.          };
  184.  
  185. /*fns*/
  186.  
  187.  
  188.  
  189. ////revdict.cpp
  190.  
  191.  
  192. #include "fuzzyset.h"
  193. #include <stdio.h>
  194.  
  195.  
  196. class attribute
  197. {
  198.         private:
  199.         str name;
  200.         fuzzyset set;
  201.  
  202.         public:
  203.         attribute();
  204.         attribute(str);
  205.         attribute(str,fuzzyset);
  206.         attribute(const attribute&);
  207. /*fns*/
  208. };
  209.        
  210. /*other fns, similar classes & main()*/
  211.  
  212.  
  213.  
  214.  
  215.  
  216. ... *^รบ!"**$%%$**^^!*&**+++**  Tagline Heaven.
  217. -- 
  218. -----------------------------------------------------------------------------
  219. | Charlotte Tomlinson  |    Mediocrity know nothing higher than itself,     |
  220. | eeyore@argonet.co.uk |       but talent instantly recognises genius.      |
  221. |---------------------------------------------------------------------------|
  222. --------- Now WWWebbed up at http://www.argonet.co.uk/users/eeyore/ ---------
  223.  
  224.